refactor(tui): 命令菜单/Activity/filepicker/progress 组件化并合并重复入口#144
Merged
minorcell merged 4 commits intoApr 5, 2026
Merged
Conversation
…activity-scroll # Conflicts: # internal/tui/update.go
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…activity-scroll # Conflicts: # internal/tui/commands.go # internal/tui/update_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
本次对 TUI 做了组件化重构,并按“功能不变、合并重复实现”的原则,集中清理了重复入口和薄包装函数。
不再保留旧行为兼容过渡代码,直接切到新交互实现。
主要改动
1) Command Menu 组件化(C1)
internal/tui/command_menu.go/、@、&的建议构建与渲染路径。@空查询进入文件浏览。2) Activity 组件化(C2)
3) @file 浏览模式(C3)
pickerFile模式并接入 filepicker。4) 进度反馈增强(C4)
5) 重复函数与入口合并(重点)
resizeComponents/resizeComposerLayout薄包装,统一到applyComponentLayout(...)。renderMessageBlock和renderMessageContent包装,统一使用...WithCopy主实现。providerItem/modelItem合并为selectionItem。matchingFileReferences包装,统一走resolveFileReferenceSuggestions。max,统一使用内建实现,保留clamp。依赖变化
go.mod/go.sum增加:github.com/charmbracelet/harmonicagithub.com/dustin/go-humanize测试与验证
已执行并通过:
go test ./internal/tuigo test ./internal/app ./internal/tuigo test ./...风险与关注点
/建议、@建议、&命令提示